<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  <%= default_javascripts %>
  <link rel="stylesheet" href="/style.css" type="text/css" media="all" />
  <title>RailsTimeClock</title>
</head>

<body>

  <div id="header">
    <div id="header-helper">
     <h1><%= link_to 'RailsTimeClock', '/' %></h1>
    </div>
  </div>
  <div id="header-bars">
    <p id="welcome"><%= t(:label_today_is, :today => Time.now.strftime("%d/%m/%Y"), :days => (BranchOffice.default.business_days if BranchOffice.count > 0), :holidays => (BranchOffice.default.holiday_days if BranchOffice.count > 0)) %></p>
    <p id="clock"><%= Time.now.strftime("%H:%M") %></p>
  </div>

  <div id="bars">
    <% if logged_in? %>
      <%= user_bar %>
      <div id="punch_bar">
        <% form_tag punch_in_hour_path do %>
          <%= submit_tag t(:punch_in), :id => "punch_in", :class => "punch_button" %>
        <% end %>
        <% form_tag punch_out_hour_path do %>
          <%= submit_tag t(:punch_out), :id => "punch_out", :class => "punch_button" %>
        <% end %>
      </div>
    <% else %>
      <div id="login_form">
      <% form_tag session_path do %>
        <%= text_field_tag('login', t(:login)) %> 
        <%= password_field_tag('password', t(:password)) %> 
        <%= submit_tag(t(:login)) %>
      <% end %>
      </div>
    <% end %>
  </div>

  <div id="content">

    <div id="content-helper">

     <% if flash[:notice] %>
        <div id="notice"><p><%= flash[:notice] %></p></div>
     <% end %>

     <%= yield %>

     <div id="footer">
       <hr />
       <address>&copy; Copyright 2010 Anderson Carvalho &amp; Caio Almeida</address>
     </div>
    </div> <!--END of content-helper -->

  </div> <!--END of content -->
 
</body>
</html>
